package com.atomos.strategy.initialize.position
{
	import flash.geom.Rectangle;
	
	import com.atomos.particle.Particle;
	import com.atomos.strategy.initialize.InitializeStrategy;
	import com.atomos.utils.RandomUtils;	

	public class BoxInitializer implements InitializeStrategy
	{
		protected var _rArea : Rectangle;
		
		public function BoxInitializer ( area : Rectangle )
		{
			_rArea = area;
		}
		
		public function initialize ( particle : Particle ) : void
		{
			particle.lastPosition.x = particle.position.x = _rArea.x + RandomUtils.random( _rArea.width );
			particle.lastPosition.y = particle.position.y = _rArea.y + RandomUtils.random( _rArea.height );
		}
	}
}